package mx.com.deckosys.utils;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JDialog;
import javax.swing.JFrame;

public class Utils {
	public static boolean estaVacio(String dato){
		if (dato==null) return true;
		if (dato.length()<1) return true;
		return false;
	}
	
	public static void centerWindow(JFrame frame){		
	    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	    int x = (screenSize.width - frame.getWidth()) / 2;  
	    int y = (screenSize.height - frame.getHeight()) / 2;
	    frame.setLocation(x, y); 
	}
	
	public static void centerWindow(JDialog frame){		
	    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	    int x = (screenSize.width - frame.getWidth()) / 2;  
	    int y = (screenSize.height - frame.getHeight()) / 2;
	    frame.setLocation(x, y); 
	}
}
